<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        /* 数值可以是正整数，负整数或0，默认为auto，数值越大，盒子越靠上 */
        .box {
            position: absolute;
            width: 200px;
            height: 200px;
        }

        .first {
            background-color: aqua;
            z-index: 1;
        }

        .second {
            background-color: blanchedalmond;
            z-index: 4;
        }

        .third {
            background-color: blue;
        }
    </style>
</head>

<body>
    <div class="box first">1</div>
    <div class="box second">2</div>
    <div class="box third">3</div>
</body>

</html>